﻿using LabManagement.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Configuration;
using System.Web.Mvc;

namespace OnlineLabManagement.Controllers
{
    public class DbControllerBase : Controller
    {

        DataManager _databaseFactory;

        public DataManager DatabaseFactory
        {
            get
            {
                if (this._databaseFactory == null)
                {
                    string connection = WebConfigurationManager.AppSettings["DBConnectionString"].ToString();
                    this._databaseFactory = new DataManager(connection);
                }
                return this._databaseFactory;
            }
        }
        public ABEntities DataBridge
        {
            get
            {
                return this.DatabaseFactory.DataFactory;
            }
        }
        public DbControllerBase()
            : base()
        {

        }

    }
}
